package main

import "fmt"

func showAddr(x *int) *int {

	fmt.Printf("Just in ShowAddr: %T %v %[1]x %[1]p\n", x, *x)
	*x = 200
	fmt.Printf("Changed in ShowAddr: %T %v %[1]x %[1]p\n", x, *x)
	return x
}

// func showAddr(x int) int {

// 	fmt.Printf("inShowAddr: %T %[1]v %[2]p\n", x, &x)
// 	return x
// }

func main() {
	var m1 = 5
	fmt.Printf("m1: %T %[1]v %[2]p\n", m1, &m1)
	var m2 = m1
	fmt.Printf("m2:%T %[1]v %[2]p\n", m2, &m2)
	m3 := showAddr(&m1)
	fmt.Println("~~~~~~~~~~~~~~showAddr called~~~~~~~~~~~~~~~~~")
	fmt.Printf("m1: %T %[1]v %[2]p\n", m1, &m1)
	fmt.Printf("m2: %T %[1]v %[2]p\n", m2, &m2)
	fmt.Printf("m3: %T %[1]v %[2]p\n", *m3, m3)

}
